package day01.text01;

import java.util.concurrent.Callable;

//创建MyCallable类，实现Callable
//Callable接收一个String类型
public class MyCallable implements Callable<String> {
    @Override
    public String call() throws Exception {
        //重写了call()方法
        for (int i = 1; i <= 20; i++) {
            System.out.println(MyThread.currentThread().getName()+"线程,执行第"+i+"次");
        }
        //结束方法返回一个"线程结束的String"
        return "线程结束";
    }
}
